package com.orafl.use.comorafluse.IOC.container;

import com.orafl.use.comorafluse.IOC.Lookup.LookUpBean;
import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Map;


public class container {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        // 注入配置类
        context.register(container.class);
        //启动应用上下文
        context.refresh();
        Map<String, OraflClass> map = context.getDefaultListableBeanFactory().getBeansOfType(OraflClass.class);
        System.out.println("************************************");
        System.out.println(map);
    }

    @Bean
    public OraflClass oraflClass1(){
       return new OraflClass().setName("1111");
    }

    @Bean
    public OraflClass oraflClass2(){
        return new OraflClass().setName("2222");
    }

}
